//Combine the work line and the pave line into a single line array,
//which the line top part is the work line. Simple means work line 
//doesn't have intersection with earth line. In other word, working on
//this area isn't a scenario that large amount of cubic meters of
//earth and stone are being added and removed at same time.
//icptLine: work line array
function renderFullWorkLineSimple(TL, TR, BL, BR, icptLine) {
	var fullWorkLine = new Array();
	
	//combine TL and TR together, sort elements by x increasingly
	// var reverseTL = new Array();
	reverseTL = TL;
	reverseTL.reverse();
	/*
		for(var i = TL.length - 1; i >= 0 ; i--) {
		reverseTL.push(TL[i]);
		}
	*/
	var paveLine = reverseTL.concat(TR);
	
	//insert workline into paveLine
	var leftPortion;
	for(var i = 0; i < icptLine.length; i++){
		if(i == 0){
			for(var j = 0; j < paveLine.length; j++) {
				if(icptLine[i][0] >= paveLine[j][0] && icptLine[i][0] <= paveLine[j<paveLine.length-1?j+1:0][0]) {
					leftPortion = paveLine.slice(0, j+1);
					leftPortion.push(icptLine[i]);
				}
			}
		}
		else if(i != icptLine.length - 1) {
			leftPortion.push(icptLine[i]);
		}
		else {
			for(var j = 0; j < paveLine.length; j++) {
				if(icptLine[i][0] >= paveLine[j][0] && icptLine[i][0] <= paveLine[j<paveLine.length-1?j+1:0][0]) {
					leftPortion.push(icptLine[i]);
					fullWorkLine = leftPortion.concat(paveLine.slice(j+1));
				}
			}
		}
	}
	
	return fullWorkLine;
}